<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>




<!DOCTYPE html>
<!--[if IE 6 ]> <html class="ie6 lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 6 ]> <html class="lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 7 ]> <html class="lte_ie7 lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 8 ]> <html class="lte_ie8 lte_ie9"> <![endif]-->
<!--[if lte IE 9 ]> <html class="lte_ie9"> <![endif]-->
<!--[if (gte IE 10)|!(IE)]><!--><html><!--<![endif]-->
<head>
    <title>查阅情况</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <script type="text/javascript" src="../../js/jquery/jquery-1.9.1.js"></script>
    <script src="../../js/news/page.js"></script>
    <script src="../../lib/laydate/laydate.js"></script>
    <script src="../../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="../../css/news/new_news.css"/>
    <link rel="stylesheet" href="/lib/pagination/style/pagination.css">
    <link rel="stylesheet" href="/css/base/base.css?20201106.1">
    <link rel="stylesheet" href="/css/notice/noticeManagement.css">
    <link rel="stylesheet" type="text/css" href="/css/commonTheme/${sessionScope.InterfaceModel}/commonTheme.css"/>

    <script type="text/javascript" >
        var MYOA_JS_SERVER = "";
        var MYOA_STATIC_SERVER = "";
    </script>
    <style>

        #rs {
            display: inline-block;
            float: left;
            width: 78px;
            height: 38px;
            line-height: 35px;
            /*  margin-right: 30px;*/
            margin-top: 20px;
            margin-bottom: 20px;
            cursor: pointer;
            border-radius: 3px;
            background: url(../../img/newReturn.png) no-repeat;
            padding-left: 19px;
            font-size: 14px;
            margin-left: 50%;

        }
        table tbody td{
            text-align: left;
            padding: 10px;
            box-sizing: border-box;
        }
        table tbody td.color{
            padding:10px 10px 10px 50px;
        }
        input{
            float: none;
        }
        .editAndDelete3{
            color: red;
        }
        .color{
            font-size: 11pt;
            color: #2a588c;
            font-weight: bold;
        }
        table tbody td textarea{
            width: 229px;
            height: 34px;
            line-height: 34px;
            padding-left: 10px;
            outline: none;
            border-radius: 4px;
            vertical-align: middle;
            font-family:"Microsoft Yahei";
        }
        table tbody td a{
            vertical-align: middle;
            font-size: 11pt;
        }
        table tbody td select{
            width: 119px;
            height: 28px;
            border-radius: 4px;
        }
        table tbody td input[type=text]{
            width: 288px;
            height: 32px;
            border-radius: 4px;
            padding-left: 10px;
            box-sizing: border-box;
        }
        .btnsava{
            padding:5px 15px;
            border-radius: 4px;
            background: #2F8AE3;
            color: #fff;
        }
        .pagediv .page-bottom-outer-layer table td{
            text-align: left;
        }
        #pagediv{
            width: 100%;
        }
        #pagediv table{
            width: 98%;
            margin: 0 auto;
        }
        #pagediv table tr:nth-child(odd){
            background-color: #F6F7F9;
        }
        #pagediv table tr:nth-child(even){
            background-color: #ffffff;
        }
        #pagediv table tr th{
            padding: 8px;
            font-size: 13pt;
            color: #2F5C8F;
            font-weight: bold;
            text-align: left;
        }
        #pagediv table tr td{
            padding: 8px;
            font-size: 11pt;
            text-align: left;
            height: 30px;
            line-height: 30px;
            word-break: keep-all;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .deleteAll{
            display: inline-block;
            width: 70px;
            height: 28px;
            position: relative;
            color: #ffffff;
            border-radius: 3px;
            background: #2b7fe0;
            text-align: center;
            line-height: 28px;
            margin-left: 20px;
        }
        .del{
            color: #e01919;
        }

    </style>


</head>


<%--<script type="text/javascript" src="/inc/js_lang.php"></script>--%>
<%--<script type="text/javascript" src="/static/js/attach.js"></script>--%>

<body class="bodycolor">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
    <tr style="border: none;">
        <td class="Big"><img src="../../img/contractinfo.png" width="17" height="17"><span class="big3">考核数据查询</span><br>
        </td>
    </tr>
</table>
<br>


<div id="pagediv">
    <table cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
        <thead>
        <tr style="background: none">
            <th style="width:12%">姓名</th>
            <th style="width:12%">用户角色</th>
            <th style="width:12%">部门名称 </th>
            <th style="width:12%">问卷名称</th>
            <th style="width:12%">问卷数量</th>
            <th style="width:10%">完成数量</th>
            <th style="width:12%">完成百分比 </th>
            <th style="width:12%">考核得分</th>
        </tr>
        </thead>
        <tbody id="taskBody">

        </tbody>
    </table>
    <div class="right" style="margin-right: 10%;">
        <!-- 分页按钮-->
        <div class="M-box3" id="dbgz_pagesd"></div>
    </div>
</div>

</table>
</body>
<script>
    $(function(){
//        获取详情id
        var flowId=$.getQueryString('flowId');
        var groupId=$.getQueryString('groupId');

        function undefindData(data) {
            if(data == undefined){
                return '';
            }else{
                return data;
            }
        }
        function undefindData1(data) {
            if(isNaN(data)){
                return 0;
            }else{
                return data;
            }
        }
        // item.paperCount/item.paperCount
        function getQueryString(name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        var flowId =getQueryString("flowId");

        var ajaxPageTr={
            data:{
                page:1,//当前处于第几页
                pageSize:5,//一页显示几条
                useFlag:true,
                flowId:flowId
            },
            page:function () {
                var me=this;
                layer.msg('加载中', {
                    icon: 16
                    ,shade: 0.01
                });
                $.ajax({
                    type:'post',
                    url:'/scoreFlowUserLeader/selFlowUsers',
                    dataType:'json',
                    data:me.data,
                    success:function(res){
                        if(res){
                            var str='';
                            $.each(res.data, function (index, item) {
                                str += '<tr flowId="'+item.flowId+'">' +
                                    '<td title="'+undefindData(item.userName)+'">' + undefindData(item.userName)+ '</td>' +
                                    '<td title="'+undefindData(item.userPrivName)+'">' + undefindData(item.userPrivName)+ '</td>' +
                                    '<td title="'+undefindData(item.deptName) +'">' + undefindData(item.deptName) + '</td>' +
                                    '<td title="'+undefindData(item.paperName)+'">' + undefindData(item.paperName)+ '</td>' +
                                    '<td title="'+undefindData(Number(item.paperCount))+'">' + undefindData(Number(item.paperCount))+ '</td>' +
                                    '<td title="'+undefindData(Number(item.downCount)) +'">' + undefindData(Number(item.downCount)) + '</td>' +
                                    '<td title="'+function () {
                                        var allNum=undefindData1(item.downCount/item.paperCount)*100 + ''
                                        var arr=allNum.split('.')
                                        if(arr.length>1){
                                            var ss=arr[1].substring(0,1)
                                            return arr[0]+'.'+ss
                                        }else{
                                            return arr[0]
                                        }
                                    }()+'%'+'">' + function () {
                                        var allNum=undefindData1(item.downCount/item.paperCount)*100 + ''
                                        var arr=allNum.split('.')
                                        if(arr.length>1){
                                            var ss=arr[1].substring(0,1)
                                            return arr[0]+'.'+ss
                                        }else{
                                            return arr[0]
                                        }
                                    }()+'%'+ '</td>' +
                                    '<td title="'+undefindData(item.scoreCount)+'">' + undefindData(item.scoreCount)+ '</td>' +
                                    '</tr>';

                            })
                            $('#taskBody').html(str)
                            layer.closeAll();
                            me.pageTwo(res.totle,me.data.pageSize,me.data.page)
                        }else{
                            layer.msg("暂无数据", {icon: 2})
                        }
                        for(var i=0;i<res.data.length;i++){
                            indexuser=res.data[i].userId;
                        }

                    }
                })

            },
            pageTwo:function (totalData, pageSize,indexs) {
                var mes=this;
                $('#dbgz_page').pagination({
                    totalData: totalData,
                    showData: pageSize,
                    prevContent:'上一页',
                    nextContent:'下一页',
                    jump: true,
                    coping: true,
                    homePage:'',
                    endPage: '',
                    current:indexs||1,
                    callback: function (index) {
                        mes.data.page=index.getCurrent();
                        mes.page();
                    }
                });
            }
        }
        ajaxPageTr.page();
    })
</script>
</html>


